import URL from '@/config/url'
import utils from '@/utils/utils'

export default {
	//活动主题页
	themeDetails(params = {}) {
		let data = {
			code: params.code,
			user_id: params.user_id
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/poster',
			data
		})
	},
	//奖品列表
	activityRecord(params = {}) {
		let data = {
			page: params.page,
			pagesize: params.pagesize,
			channel: params.channel,
			user_id: params.user_id
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/win/record',
			data
		})
	},
	//虚拟商品列表
	activityGoods(params = {}) {
		let data = {
			page: params.page,
			pagesize: params.pagesize,
			activity_code: params.activity_code,
			user_id: params.user_id
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/goodrel/lists',
			data
		})
	},
	//奖品核销
	prizeWriteOff(params = {}) {
		let data = {
			prize_id: params.prize_id,
			prize_code: params.prize_code,
			user_id: params.user_id
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/prize/exchange',
			data
		})
	},
	//抽奖浮层显示
	luckDrawShow(params = {}) {
		let data = {

		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/buoy',
			data
		})
	},
	//奖品弹层,订单奖励
	orderRewardShow(params = {}) {
		let data = {
			type: params.type,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/order/reward',
			data
		})
	},
	//家装秘籍
	articleDetail(params = {}) {
		let data = {
			prize_id: params.prize_id,
			prize_code: params.prize_code,
			user_id: params.user_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/article/detail',
			data
		})
	},
	prizeValid(params = {}) {
		let data = {
			prize_code: params.prize_code,
			//user_id:params.user_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/prize/valid',
			data
		})
	},
	//抽奖奖品参数
	luckDrawPrize(params = {}) {
		let data = {
			item_id: params.item_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/prize/data',
			data
		})
	},
	//可抽奖次数
	drawcount(params = {}) {
		let data = {
			user_id: params.user_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/drawcount',
			data
		})
	},
	writePrize(params = {}) {
		let data = {
			prize_id: params.prize_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/write/prize',
			data
		})
	},
	//幸运榜单
	luckDrawRanking(params = {}) {
		let data = {
			prize_id: params.prize_id,
			page: params.page,
			pagesize: params.pagesize,
			item_id:params.item_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/luckranking',
			data
		})
	},
	//礼包分享
	giftShareRecord(params = {}) {
		let data = {
			pagesize: params.pagesize,
			page: params.page,
			share_user_id: params.share_user_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/share/record',
			data
		})
	},
	//礼品分享统计
	shareStatistics(params = {}) {
		let data = {
			share_user_id: params.share_user_id,
		}
		return utils.uniRequest({
			//url: URL.ENTERs + '/client/activity/share/statistics',
			url: URL.BASE + '/activity/share/statistics',
			data
		})
	},
	//订单满金额弹窗
	orderReward(params = {}) {
		let data = {
			type: params.type,
			order_id: params.order_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/order/reward',
			data
		})
	},
	//是否授权
	toAuthor(params = {}) {
		let data = {
			mobile: params.mobile,
		}
		return utils.uniRequest({
			url: URL.BASE + '/base/toAuthor',
			data
		})
	},
	//子活动详情
	activityBaseInfo(params = {}) {
		let data = {
			item_id: params.item_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/baseInfo',
			data
		})
	},
	//参与活动人员
	activityNameList(params = {}) {
		let data = {
			pagesize: params.pagesize,
			page: params.page,
			activity_no: params.activity_no,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/nameList',
			data
		})
	},
	//中奖名单
	winningList(params = {}) {
		let data = {
			activity_no: params.activity_no,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/wind/nameList',
			data
		})
	},
	//验证活动状态
	activityValid(params = {}) {
		let data = {
			item_id: params.item_id,
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/valid/status',
			data
		})
	},
	//减抽奖次数
	luckDrawDec(params = {}) {
		let data = {
			
		}
		return utils.uniRequest({
			url: URL.BASE + '/activity/drawcountuser/dec',
			data
		})
	},
	//特价专区
	specialOffer(params = {}) {
		let data = {
			page: params.page,
			pagesize:params.pagesize,
		}
		return utils.uniRequest({
			url: URL.BASE + '/shop/goods/cheap/area',
			data
		})
	}
}
